ASSUME CS:CODE,DS:DATA

DATA SEGMENT
    ARRAY DB "ABCdef12mQT$"
    UPPER_COUNT DW 0
DATA ENDS

CODE SEGMENT
    MAIN:
    MOV AX,DATA
    MOV DS,AX
    MOV SI,0
    MOV CX,12

    COUNT:
    MOV AL,[SI + ARRAY]
    CMP AL,'$'
    JE END_COUNT

    CMP AL,'A'
    JB NEXT
    CMP AL,'Z'
    JA NEXT

    INC UPPER_COUNT

    NEXT:
    INC SI
    LOOP COUNT

    END_COUNT:
    MOV AX,4C00H
    INT 21H
CODE ENDS
END MAIN